<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增部门')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-dept-add" >
        <input name="idQryData" type="hidden" th:value="${idQryData}"/>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">名称：</label>
                    <div class="col-sm-8">
                        <input name="na" placeholder="名称" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">分类：</label>
                    <div class="col-sm-8">
                        <select name="idQryCls" class="form-control m-b" th:with="type=${@qryClassService.selectQryClassList(null)}">
                            <option th:each="item : ${type}" th:text="${item.na}" th:value="${item.idQryCls}" th:selected="*{idQryCls} eq ${item.idQryCls} "></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">默认日期：</label>
                    <div class="col-sm-8">
                        <select name="sdDefDt" class="form-control m-b">
                            <option value="oneWeek" >一周</option>
                            <option value="oneMonth" >一月</option>
                            <option value="oneQuarter">一季度</option>
                            <option value="oneYear" >一年</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">功能标志：</label>
                    <div class="col-sm-8">
                        <label class="toggle-switch switch-solid">
                            <input type="checkbox" name="fgMenu">
                            <span></span>
                        </label>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">维度1：</label>
                    <div class="col-sm-8">
                        <select name="dim1" id="dim1" class="form-control m-b">
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">选择类型1：</label>
                    <div class="col-sm-8">
                        <select name="euSelDim1" class="form-control m-b">
                            <option value= ></option>
                            <option value=0 >单选</option>
                            <option value=1 >多选</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">维度2：</label>
                    <div class="col-sm-8">
                        <select name="dim2" id="dim2" class="form-control m-b">
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">选择类型2：</label>
                    <div class="col-sm-8">
                        <select name="euSelDim2" class="form-control m-b">
                            <option value= ></option>
                            <option value=0 >单选</option>
                            <option value=1 >多选</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">维度3：</label>
                    <div class="col-sm-8">
                        <select name="dim3" id="dim3" class="form-control m-b">
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">选择类型3：</label>
                    <div class="col-sm-8">
                        <select name="euSelDim3" class="form-control m-b">
                            <option value= ></option>
                            <option value=0 >单选</option>
                            <option value=1 >多选</option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "query/data";
    var dims = "[[${dims}]]";
    $(function() {
        var dim,options="<option value=''></option>";

        $.each(dims.split(";"),function (index,item) {
            if(item!=null && item!="") {
                dim = item.split(",");
                options += "<option value='"+dim[0]+"'>"+dim[1]+"</option>"
            }
        });
        $("#dim1").html(options);
    });
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-dept-add').serialize());
        }
    }

    function doSubmit(index, layero){
        $.modal.close(index);
    }
</script>
</body>
</html>